﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Common;

namespace AdminUI.Controllers
{
    public class StrategController : BaseController
    {
        // GET: Strateg
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Add()
        {
            var data = HttpHelper.HttpGet<Result<List<Param_Strateg>>>(Tools.ApiPath + "api/StrategType/GetAll", "get").Data;
            return PartialView(data);
        }
        public ActionResult Edit(int? id)
        {
            if (!id.HasValue)
            {
                return View("error");
            }
            var type = HttpHelper.HttpGet<Result<List<Param_StrategType>>>(Tools.ApiPath + "api/StrategType/GetAll", "get").Data;
            ViewBag.Type = type;
            var data = HttpHelper.HttpGet<Result<Param_Strateg>>(Tools.ApiPath + "api/Strateg/Find/" + id.Value, "get").Data;
            return PartialView(data);
        }
    }
}